package factor1;

import com.bit.utils.FileUtils;

import java.lang.reflect.Proxy;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-08-20
 * Time: 2:03
 */
public class Test07 {
    public static void main(String[] args) {
        IUserFactor adminUserFactor = new AdminUserFactor();
        User adminUser = adminUserFactor.createUser("张三",10);

        IUserFactor normalUserFactor = new NormalUserFactor();
        User normalUser1 = normalUserFactor.createUser("李四",20);
        User normalUser2 = normalUserFactor.createUser("王麻子",30);

        ProxyUser proxyUser1 = new ProxyUser(adminUser);
        proxyUser1.addBook("西游记");
        ProxyUser proxyUser2 = new ProxyUser(normalUser1);
        proxyUser2.borrowBook("三国演义");
        ProxyUser proxyUser3 = new ProxyUser(normalUser2);
        proxyUser3.borrowBook("水浒传");
    }
}
